
// Copyright (C) 2009-2011 Luca Piccioni
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;

#pragma warning disable 1572, 1573

namespace Derm.OpenGL {

	/// <summary>
	/// Implementation of the OpenGL specification 
	/// </summary>
	public unsafe partial class Glx : ProcLoader
	{

		/// <summary>
		/// Binding for glXAssociateDMPbufferSGIX function.
		/// </summary>
		/// <param name="dpy">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="pbuffer">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="params">
		/// A <see cref="T:System.IntPtr*"/>.
		/// </param>
		/// <param name="dmbuffer">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		public static bool AssociateDMPbufferSGIX(IntPtr dpy, IntPtr pbuffer, ref IntPtr[] @params, IntPtr dmbuffer) {
			bool retvalue;
			unsafe {
				fixed (IntPtr* fp_params = @params)
				{
					if      (Delegates.pglXAssociateDMPbufferSGIX != null)
						retvalue = (Delegates.pglXAssociateDMPbufferSGIX(dpy, pbuffer, fp_params, dmbuffer));
					else
						throw new InvalidOperationException("binding point AssociateDMPbufferSGIX cannot be found");
				}
			}
			LogProc("glXAssociateDMPbufferSGIX({0}, {1}, {2}, {3}) = {4}", dpy, pbuffer, @params, dmbuffer, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for glXBindChannelToWindowSGIX function.
		/// </summary>
		/// <param name="display">
		/// A <see cref="T:System.IntPtr*"/>.
		/// </param>
		/// <param name="screen">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="channel">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="window">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		public static int BindChannelToWindowSGIX(ref IntPtr[] display, int screen, int channel, IntPtr window) {
			int retvalue;
			unsafe {
				fixed (IntPtr* fp_display = display)
				{
					if      (Delegates.pglXBindChannelToWindowSGIX != null)
						retvalue = (Delegates.pglXBindChannelToWindowSGIX(fp_display, screen, channel, window));
					else
						throw new InvalidOperationException("binding point BindChannelToWindowSGIX cannot be found");
				}
			}
			LogProc("glXBindChannelToWindowSGIX({0}, {1}, {2}, {3}) = {4}", display, screen, channel, window, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for glXBindHyperpipeSGIX function.
		/// </summary>
		/// <param name="dpy">
		/// A <see cref="T:System.IntPtr*"/>.
		/// </param>
		/// <param name="hpId">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		public static int BindHyperpipeSGIX(ref IntPtr[] dpy, int hpId) {
			int retvalue;
			unsafe {
				fixed (IntPtr* fp_dpy = dpy)
				{
					if      (Delegates.pglXBindHyperpipeSGIX != null)
						retvalue = (Delegates.pglXBindHyperpipeSGIX(fp_dpy, hpId));
					else
						throw new InvalidOperationException("binding point BindHyperpipeSGIX cannot be found");
				}
			}
			LogProc("glXBindHyperpipeSGIX({0}, {1}) = {2}", dpy, hpId, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for glXBindSwapBarrierSGIX function.
		/// </summary>
		/// <param name="window">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="barrier">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		public static void BindSwapBarrierSGIX(Int32 window, Int32 barrier) {
			if      (Delegates.pglXBindSwapBarrierSGIX != null)
				Delegates.pglXBindSwapBarrierSGIX(window, barrier);
			else
				throw new InvalidOperationException("binding point BindSwapBarrierSGIX cannot be found");
			LogProc("glXBindSwapBarrierSGIX({0}, {1})", window, barrier);
		}

		/// <summary>
		/// Binding for glXChangeDrawableAttributesSGIX function.
		/// </summary>
		/// <param name="drawable">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		public static void ChangeDrawableAttributesSGIX(Int32 drawable) {
			if      (Delegates.pglXChangeDrawableAttributesSGIX != null)
				Delegates.pglXChangeDrawableAttributesSGIX(drawable);
			else
				throw new InvalidOperationException("binding point ChangeDrawableAttributesSGIX cannot be found");
			LogProc("glXChangeDrawableAttributesSGIX({0})", drawable);
		}

		/// <summary>
		/// Binding for glXChannelRectSGIX function.
		/// </summary>
		/// <param name="display">
		/// A <see cref="T:System.IntPtr*"/>.
		/// </param>
		/// <param name="screen">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="channel">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="x">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="y">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="w">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="h">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		public static int ChannelRectSGIX(ref IntPtr[] display, int screen, int channel, int x, int y, int w, int h) {
			int retvalue;
			unsafe {
				fixed (IntPtr* fp_display = display)
				{
					if      (Delegates.pglXChannelRectSGIX != null)
						retvalue = (Delegates.pglXChannelRectSGIX(fp_display, screen, channel, x, y, w, h));
					else
						throw new InvalidOperationException("binding point ChannelRectSGIX cannot be found");
				}
			}
			LogProc("glXChannelRectSGIX({0}, {1}, {2}, {3}, {4}, {5}, {6}) = {7}", display, screen, channel, x, y, w, h, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for glXChannelRectSyncSGIX function.
		/// </summary>
		/// <param name="display">
		/// A <see cref="T:System.IntPtr*"/>.
		/// </param>
		/// <param name="screen">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="channel">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="synctype">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		public static int ChannelRectSyncSGIX(ref IntPtr[] display, int screen, int channel, int synctype) {
			int retvalue;
			unsafe {
				fixed (IntPtr* fp_display = display)
				{
					if      (Delegates.pglXChannelRectSyncSGIX != null)
						retvalue = (Delegates.pglXChannelRectSyncSGIX(fp_display, screen, channel, synctype));
					else
						throw new InvalidOperationException("binding point ChannelRectSyncSGIX cannot be found");
				}
			}
			LogProc("glXChannelRectSyncSGIX({0}, {1}, {2}, {3}) = {4}", display, screen, channel, synctype, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for glXCopySubBufferMESA function.
		/// </summary>
		/// <param name="dpy">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="drawable">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="x">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="y">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="width">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="height">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		public static void CopySubBufferMESA(IntPtr dpy, IntPtr drawable, int x, int y, int width, int height) {
			if      (Delegates.pglXCopySubBufferMESA != null)
				Delegates.pglXCopySubBufferMESA(dpy, drawable, x, y, width, height);
			else
				throw new InvalidOperationException("binding point CopySubBufferMESA cannot be found");
			LogProc("glXCopySubBufferMESA({0}, {1}, {2}, {3}, {4}, {5})", dpy, drawable, x, y, width, height);
		}

		/// <summary>
		/// Binding for glXCreateContextWithConfigSGIX function.
		/// </summary>
		/// <param name="gc_id">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="screen">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="config">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="share_list">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		public static void CreateContextWithConfigSGIX(Int32 gc_id, Int32 screen, Int32 config, Int32 share_list) {
			if      (Delegates.pglXCreateContextWithConfigSGIX != null)
				Delegates.pglXCreateContextWithConfigSGIX(gc_id, screen, config, share_list);
			else
				throw new InvalidOperationException("binding point CreateContextWithConfigSGIX cannot be found");
			LogProc("glXCreateContextWithConfigSGIX({0}, {1}, {2}, {3})", gc_id, screen, config, share_list);
		}

		/// <summary>
		/// Binding for glXCreateGLXPbufferSGIX function.
		/// </summary>
		/// <param name="config">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="pbuffer">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		public static void CreateGLXPbufferSGIX(Int32 config, Int32 pbuffer) {
			if      (Delegates.pglXCreateGLXPbufferSGIX != null)
				Delegates.pglXCreateGLXPbufferSGIX(config, pbuffer);
			else
				throw new InvalidOperationException("binding point CreateGLXPbufferSGIX cannot be found");
			LogProc("glXCreateGLXPbufferSGIX({0}, {1})", config, pbuffer);
		}

		/// <summary>
		/// Binding for glXCreateGLXPixmapMESA function.
		/// </summary>
		/// <param name="dpy">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="visual">
		/// A <see cref="T:Glx.XVisualInfo"/>.
		/// </param>
		/// <param name="pixmap">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="cmap">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		public static IntPtr CreateGLXPixmapMESA(IntPtr dpy, Glx.XVisualInfo visual, IntPtr pixmap, IntPtr cmap) {
			IntPtr retvalue;
			if      (Delegates.pglXCreateGLXPixmapMESA != null)
				retvalue = (Delegates.pglXCreateGLXPixmapMESA(dpy, visual, pixmap, cmap));
			else
				throw new InvalidOperationException("binding point CreateGLXPixmapMESA cannot be found");
			LogProc("glXCreateGLXPixmapMESA({0}, {1}, {2}, {3}) = {4}", dpy, visual, pixmap, cmap, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for glXCreateGLXPixmapWithConfigSGIX function.
		/// </summary>
		/// <param name="config">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="pixmap">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="glxpixmap">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		public static void CreateGLXPixmapWithConfigSGIX(Int32 config, Int32 pixmap, Int32 glxpixmap) {
			if      (Delegates.pglXCreateGLXPixmapWithConfigSGIX != null)
				Delegates.pglXCreateGLXPixmapWithConfigSGIX(config, pixmap, glxpixmap);
			else
				throw new InvalidOperationException("binding point CreateGLXPixmapWithConfigSGIX cannot be found");
			LogProc("glXCreateGLXPixmapWithConfigSGIX({0}, {1}, {2})", config, pixmap, glxpixmap);
		}

		/// <summary>
		/// Binding for glXCreateGLXVideoSourceSGIX function.
		/// </summary>
		/// <param name="dpy">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="screen">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="server">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="path">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="class">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="node">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		public static void CreateGLXVideoSourceSGIX(Int32 dpy, Int32 screen, Int32 server, Int32 path, Int32 @class, Int32 node) {
			if      (Delegates.pglXCreateGLXVideoSourceSGIX != null)
				Delegates.pglXCreateGLXVideoSourceSGIX(dpy, screen, server, path, @class, node);
			else
				throw new InvalidOperationException("binding point CreateGLXVideoSourceSGIX cannot be found");
			LogProc("glXCreateGLXVideoSourceSGIX({0}, {1}, {2}, {3}, {4}, {5})", dpy, screen, server, path, @class, node);
		}

		/// <summary>
		/// Binding for glXCushionSGI function.
		/// </summary>
		/// <param name="dpy">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="window">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="cushion">
		/// A <see cref="T:System.Single"/>.
		/// </param>
		public static void CushionSGI(IntPtr dpy, IntPtr window, float cushion) {
			if      (Delegates.pglXCushionSGI != null)
				Delegates.pglXCushionSGI(dpy, window, cushion);
			else
				throw new InvalidOperationException("binding point CushionSGI cannot be found");
			LogProc("glXCushionSGI({0}, {1}, {2})", dpy, window, cushion);
		}

		/// <summary>
		/// Binding for glXDestroyGLXPbufferSGIX function.
		/// </summary>
		/// <param name="pbuffer">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		public static void DestroyGLXPbufferSGIX(Int32 pbuffer) {
			if      (Delegates.pglXDestroyGLXPbufferSGIX != null)
				Delegates.pglXDestroyGLXPbufferSGIX(pbuffer);
			else
				throw new InvalidOperationException("binding point DestroyGLXPbufferSGIX cannot be found");
			LogProc("glXDestroyGLXPbufferSGIX({0})", pbuffer);
		}

		/// <summary>
		/// Binding for glXDestroyGLXVideoSourceSGIX function.
		/// </summary>
		/// <param name="dpy">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="glxvideosource">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		public static void DestroyGLXVideoSourceSGIX(Int32 dpy, Int32 glxvideosource) {
			if      (Delegates.pglXDestroyGLXVideoSourceSGIX != null)
				Delegates.pglXDestroyGLXVideoSourceSGIX(dpy, glxvideosource);
			else
				throw new InvalidOperationException("binding point DestroyGLXVideoSourceSGIX cannot be found");
			LogProc("glXDestroyGLXVideoSourceSGIX({0}, {1})", dpy, glxvideosource);
		}

		/// <summary>
		/// Binding for glXDestroyHyperpipeConfigSGIX function.
		/// </summary>
		/// <param name="dpy">
		/// A <see cref="T:System.IntPtr*"/>.
		/// </param>
		/// <param name="hpId">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		public static int DestroyHyperpipeConfigSGIX(ref IntPtr[] dpy, int hpId) {
			int retvalue;
			unsafe {
				fixed (IntPtr* fp_dpy = dpy)
				{
					if      (Delegates.pglXDestroyHyperpipeConfigSGIX != null)
						retvalue = (Delegates.pglXDestroyHyperpipeConfigSGIX(fp_dpy, hpId));
					else
						throw new InvalidOperationException("binding point DestroyHyperpipeConfigSGIX cannot be found");
				}
			}
			LogProc("glXDestroyHyperpipeConfigSGIX({0}, {1}) = {2}", dpy, hpId, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for glXGetCurrentReadDrawableSGI function.
		/// </summary>
		public static IntPtr GetCurrentReadDrawableSGI() {
			IntPtr retvalue;
			if      (Delegates.pglXGetCurrentReadDrawableSGI != null)
				retvalue = (Delegates.pglXGetCurrentReadDrawableSGI());
			else
				throw new InvalidOperationException("binding point GetCurrentReadDrawableSGI cannot be found");
			LogProc("glXGetCurrentReadDrawableSGI()");
			return (retvalue);
		}

		/// <summary>
		/// Binding for glXGetDrawableAttributesSGIX function.
		/// </summary>
		/// <param name="drawable">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		public static void GetDrawableAttributesSGIX(Int32 drawable) {
			if      (Delegates.pglXGetDrawableAttributesSGIX != null)
				Delegates.pglXGetDrawableAttributesSGIX(drawable);
			else
				throw new InvalidOperationException("binding point GetDrawableAttributesSGIX cannot be found");
			LogProc("glXGetDrawableAttributesSGIX({0})", drawable);
		}

		/// <summary>
		/// Binding for glXGetFBConfigsSGIX function.
		/// </summary>
		public static void GetFBConfigsSGIX() {
			if      (Delegates.pglXGetFBConfigsSGIX != null)
				Delegates.pglXGetFBConfigsSGIX();
			else
				throw new InvalidOperationException("binding point GetFBConfigsSGIX cannot be found");
			LogProc("glXGetFBConfigsSGIX()");
		}

		/// <summary>
		/// Binding for glXGetMscRateOML function.
		/// </summary>
		/// <param name="dpy">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="drawable">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="numerator">
		/// A <see cref="T:System.Int32*"/>.
		/// </param>
		/// <param name="denominator">
		/// A <see cref="T:System.Int32*"/>.
		/// </param>
		public static bool GetMscRateOML(IntPtr dpy, IntPtr drawable, ref Int32[] numerator, ref Int32[] denominator) {
			bool retvalue;
			unsafe {
				fixed (Int32* fp_numerator = numerator)
				fixed (Int32* fp_denominator = denominator)
				{
					if      (Delegates.pglXGetMscRateOML != null)
						retvalue = (Delegates.pglXGetMscRateOML(dpy, drawable, fp_numerator, fp_denominator));
					else
						throw new InvalidOperationException("binding point GetMscRateOML cannot be found");
				}
			}
			LogProc("glXGetMscRateOML({0}, {1}, {2}, {3}) = {4}", dpy, drawable, numerator, denominator, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for glXGetSelectedEventSGIX function.
		/// </summary>
		/// <param name="dpy">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="drawable">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="mask">
		/// A <see cref="T:System.UInt32*"/>.
		/// </param>
		public static void GetSelectedEventSGIX(IntPtr dpy, IntPtr drawable, ref UInt32[] mask) {
			unsafe {
				fixed (UInt32* fp_mask = mask)
				{
					if      (Delegates.pglXGetSelectedEventSGIX != null)
						Delegates.pglXGetSelectedEventSGIX(dpy, drawable, fp_mask);
					else
						throw new InvalidOperationException("binding point GetSelectedEventSGIX cannot be found");
				}
			}
			LogProc("glXGetSelectedEventSGIX({0}, {1}, {2})", dpy, drawable, mask);
		}

		/// <summary>
		/// Binding for glXGetSyncValuesOML function.
		/// </summary>
		/// <param name="dpy">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="drawable">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="ust">
		/// A <see cref="T:System.Int64*"/>.
		/// </param>
		/// <param name="msc">
		/// A <see cref="T:System.Int64*"/>.
		/// </param>
		/// <param name="sbc">
		/// A <see cref="T:System.Int64*"/>.
		/// </param>
		public static bool GetSyncValuesOML(IntPtr dpy, IntPtr drawable, ref Int64[] ust, ref Int64[] msc, ref Int64[] sbc) {
			bool retvalue;
			unsafe {
				fixed (Int64* fp_ust = ust)
				fixed (Int64* fp_msc = msc)
				fixed (Int64* fp_sbc = sbc)
				{
					if      (Delegates.pglXGetSyncValuesOML != null)
						retvalue = (Delegates.pglXGetSyncValuesOML(dpy, drawable, fp_ust, fp_msc, fp_sbc));
					else
						throw new InvalidOperationException("binding point GetSyncValuesOML cannot be found");
				}
			}
			LogProc("glXGetSyncValuesOML({0}, {1}, {2}, {3}, {4}) = {5}", dpy, drawable, ust, msc, sbc, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for glXGetTransparentIndexSUN function.
		/// </summary>
		/// <param name="dpy">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="overlay">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="underlay">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="pTransparentIndex">
		/// A <see cref="T:System.IntPtr*"/>.
		/// </param>
		public static Int32 GetTransparentIndexSUN(IntPtr dpy, IntPtr overlay, IntPtr underlay, ref IntPtr[] pTransparentIndex) {
			Int32 retvalue;
			unsafe {
				fixed (IntPtr* fp_pTransparentIndex = pTransparentIndex)
				{
					if      (Delegates.pglXGetTransparentIndexSUN != null)
						retvalue = (Delegates.pglXGetTransparentIndexSUN(dpy, overlay, underlay, fp_pTransparentIndex));
					else
						throw new InvalidOperationException("binding point GetTransparentIndexSUN cannot be found");
				}
			}
			LogProc("glXGetTransparentIndexSUN({0}, {1}, {2}, {3}) = {4}", dpy, overlay, underlay, pTransparentIndex, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for glXGetVideoSyncSGI function.
		/// </summary>
		/// <param name="count">
		/// A <see cref="T:System.UInt32*"/>.
		/// </param>
		public static int GetVideoSyncSGI(ref UInt32[] count) {
			int retvalue;
			unsafe {
				fixed (UInt32* fp_count = count)
				{
					if      (Delegates.pglXGetVideoSyncSGI != null)
						retvalue = (Delegates.pglXGetVideoSyncSGI(fp_count));
					else
						throw new InvalidOperationException("binding point GetVideoSyncSGI cannot be found");
				}
			}
			LogProc("glXGetVideoSyncSGI({0}) = {1}", count, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for glXHyperpipeAttribSGIX function.
		/// </summary>
		/// <param name="dpy">
		/// A <see cref="T:System.IntPtr*"/>.
		/// </param>
		/// <param name="timeSlice">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="attrib">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="size">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="attribList">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		public static int HyperpipeAttribSGIX(ref IntPtr[] dpy, int timeSlice, int attrib, int size, object attribList) {
			int retvalue;
			unsafe {
				GCHandle pp_attribList = GCHandle.Alloc(attribList, GCHandleType.Pinned);
				try {
					fixed (IntPtr* fp_dpy = dpy)
					{
						if      (Delegates.pglXHyperpipeAttribSGIX != null)
							retvalue = (Delegates.pglXHyperpipeAttribSGIX(fp_dpy, timeSlice, attrib, size, pp_attribList.AddrOfPinnedObject()));
						else
							throw new InvalidOperationException("binding point HyperpipeAttribSGIX cannot be found");
					}
				} finally {
					pp_attribList.Free();
				}
			}
			LogProc("glXHyperpipeAttribSGIX({0}, {1}, {2}, {3}, {4}) = {5}", dpy, timeSlice, attrib, size, attribList, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for glXHyperpipeConfigSGIX function.
		/// </summary>
		/// <param name="dpy">
		/// A <see cref="T:System.IntPtr*"/>.
		/// </param>
		/// <param name="networkId">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="npipes">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="cfg">
		/// A <see cref="T:System.IntPtr*"/>.
		/// </param>
		/// <param name="hpId">
		/// A <see cref="T:System.Int32*"/>.
		/// </param>
		public static int HyperpipeConfigSGIX(ref IntPtr[] dpy, int networkId, int npipes, IntPtr[] cfg, ref int[] hpId) {
			int retvalue;
			unsafe {
				fixed (IntPtr* fp_dpy = dpy)
				fixed (IntPtr* fp_cfg = cfg)
				fixed (int* fp_hpId = hpId)
				{
					if      (Delegates.pglXHyperpipeConfigSGIX != null)
						retvalue = (Delegates.pglXHyperpipeConfigSGIX(fp_dpy, networkId, npipes, fp_cfg, fp_hpId));
					else
						throw new InvalidOperationException("binding point HyperpipeConfigSGIX cannot be found");
				}
			}
			LogProc("glXHyperpipeConfigSGIX({0}, {1}, {2}, {3}, {4}) = {5}", dpy, networkId, npipes, cfg, hpId, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for glXJoinSwapGroupSGIX function.
		/// </summary>
		/// <param name="window">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="group">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		public static void JoinSwapGroupSGIX(Int32 window, Int32 group) {
			if      (Delegates.pglXJoinSwapGroupSGIX != null)
				Delegates.pglXJoinSwapGroupSGIX(window, group);
			else
				throw new InvalidOperationException("binding point JoinSwapGroupSGIX cannot be found");
			LogProc("glXJoinSwapGroupSGIX({0}, {1})", window, group);
		}

		/// <summary>
		/// Binding for glXMakeCurrentReadSGI function.
		/// </summary>
		/// <param name="drawable">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="readdrawable">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="context">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		public static void MakeCurrentReadSGI(Int32 drawable, Int32 readdrawable, Int32 context) {
			if      (Delegates.pglXMakeCurrentReadSGI != null)
				Delegates.pglXMakeCurrentReadSGI(drawable, readdrawable, context);
			else
				throw new InvalidOperationException("binding point MakeCurrentReadSGI cannot be found");
			LogProc("glXMakeCurrentReadSGI({0}, {1}, {2})", drawable, readdrawable, context);
		}

		/// <summary>
		/// Binding for glXQueryChannelDeltasSGIX function.
		/// </summary>
		/// <param name="display">
		/// A <see cref="T:System.IntPtr*"/>.
		/// </param>
		/// <param name="screen">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="channel">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="x">
		/// A <see cref="T:System.Int32*"/>.
		/// </param>
		/// <param name="y">
		/// A <see cref="T:System.Int32*"/>.
		/// </param>
		/// <param name="w">
		/// A <see cref="T:System.Int32*"/>.
		/// </param>
		/// <param name="h">
		/// A <see cref="T:System.Int32*"/>.
		/// </param>
		public static int QueryChannelDeltasSGIX(ref IntPtr[] display, int screen, int channel, ref int[] x, ref int[] y, ref int[] w, ref int[] h) {
			int retvalue;
			unsafe {
				fixed (IntPtr* fp_display = display)
				fixed (int* fp_x = x)
				fixed (int* fp_y = y)
				fixed (int* fp_w = w)
				fixed (int* fp_h = h)
				{
					if      (Delegates.pglXQueryChannelDeltasSGIX != null)
						retvalue = (Delegates.pglXQueryChannelDeltasSGIX(fp_display, screen, channel, fp_x, fp_y, fp_w, fp_h));
					else
						throw new InvalidOperationException("binding point QueryChannelDeltasSGIX cannot be found");
				}
			}
			LogProc("glXQueryChannelDeltasSGIX({0}, {1}, {2}, {3}, {4}, {5}, {6}) = {7}", display, screen, channel, x, y, w, h, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for glXQueryChannelRectSGIX function.
		/// </summary>
		/// <param name="display">
		/// A <see cref="T:System.IntPtr*"/>.
		/// </param>
		/// <param name="screen">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="channel">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="dx">
		/// A <see cref="T:System.Int32*"/>.
		/// </param>
		/// <param name="dy">
		/// A <see cref="T:System.Int32*"/>.
		/// </param>
		/// <param name="dw">
		/// A <see cref="T:System.Int32*"/>.
		/// </param>
		/// <param name="dh">
		/// A <see cref="T:System.Int32*"/>.
		/// </param>
		public static int QueryChannelRectSGIX(ref IntPtr[] display, int screen, int channel, ref int[] dx, ref int[] dy, ref int[] dw, ref int[] dh) {
			int retvalue;
			unsafe {
				fixed (IntPtr* fp_display = display)
				fixed (int* fp_dx = dx)
				fixed (int* fp_dy = dy)
				fixed (int* fp_dw = dw)
				fixed (int* fp_dh = dh)
				{
					if      (Delegates.pglXQueryChannelRectSGIX != null)
						retvalue = (Delegates.pglXQueryChannelRectSGIX(fp_display, screen, channel, fp_dx, fp_dy, fp_dw, fp_dh));
					else
						throw new InvalidOperationException("binding point QueryChannelRectSGIX cannot be found");
				}
			}
			LogProc("glXQueryChannelRectSGIX({0}, {1}, {2}, {3}, {4}, {5}, {6}) = {7}", display, screen, channel, dx, dy, dw, dh, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for glXQueryGLXPbufferSGIX function.
		/// </summary>
		/// <param name="dpy">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="pbuf">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="attribute">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="value">
		/// A <see cref="T:System.UInt32*"/>.
		/// </param>
		public static int QueryGLXPbufferSGIX(IntPtr dpy, IntPtr pbuf, int attribute, ref UInt32[] value) {
			int retvalue;
			unsafe {
				fixed (UInt32* fp_value = value)
				{
					if      (Delegates.pglXQueryGLXPbufferSGIX != null)
						retvalue = (Delegates.pglXQueryGLXPbufferSGIX(dpy, pbuf, attribute, fp_value));
					else
						throw new InvalidOperationException("binding point QueryGLXPbufferSGIX cannot be found");
				}
			}
			LogProc("glXQueryGLXPbufferSGIX({0}, {1}, {2}, {3}) = {4}", dpy, pbuf, attribute, value, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for glXQueryHyperpipeAttribSGIX function.
		/// </summary>
		/// <param name="dpy">
		/// A <see cref="T:System.IntPtr*"/>.
		/// </param>
		/// <param name="timeSlice">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="attrib">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="size">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="returnAttribList">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		public static int QueryHyperpipeAttribSGIX(ref IntPtr[] dpy, int timeSlice, int attrib, int size, object returnAttribList) {
			int retvalue;
			unsafe {
				GCHandle pp_returnAttribList = GCHandle.Alloc(returnAttribList, GCHandleType.Pinned);
				try {
					fixed (IntPtr* fp_dpy = dpy)
					{
						if      (Delegates.pglXQueryHyperpipeAttribSGIX != null)
							retvalue = (Delegates.pglXQueryHyperpipeAttribSGIX(fp_dpy, timeSlice, attrib, size, pp_returnAttribList.AddrOfPinnedObject()));
						else
							throw new InvalidOperationException("binding point QueryHyperpipeAttribSGIX cannot be found");
					}
				} finally {
					pp_returnAttribList.Free();
				}
			}
			LogProc("glXQueryHyperpipeAttribSGIX({0}, {1}, {2}, {3}, {4}) = {5}", dpy, timeSlice, attrib, size, returnAttribList, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for glXQueryHyperpipeBestAttribSGIX function.
		/// </summary>
		/// <param name="dpy">
		/// A <see cref="T:System.IntPtr*"/>.
		/// </param>
		/// <param name="timeSlice">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="attrib">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="size">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="attribList">
		/// A <see cref="T:System.Int32*"/>.
		/// </param>
		/// <param name="returnAttribList">
		/// A <see cref="T:System.Int32*"/>.
		/// This parameter holds data returned from function.
		/// </param>
		public static int QueryHyperpipeBestAttribSGIX(ref IntPtr[] dpy, int timeSlice, int attrib, int size, Int32[] attribList, [Out] Int32[] returnAttribList) {
			int retvalue;
			unsafe {
				fixed (IntPtr* fp_dpy = dpy)
				fixed (Int32* fp_attribList = attribList)
				fixed (Int32* fp_returnAttribList = returnAttribList)
				{
					if      (Delegates.pglXQueryHyperpipeBestAttribSGIX != null)
						retvalue = (Delegates.pglXQueryHyperpipeBestAttribSGIX(fp_dpy, timeSlice, attrib, size, fp_attribList, fp_returnAttribList));
					else
						throw new InvalidOperationException("binding point QueryHyperpipeBestAttribSGIX cannot be found");
				}
			}
			LogProc("glXQueryHyperpipeBestAttribSGIX({0}, {1}, {2}, {3}, {4}, {5}) = {6}", dpy, timeSlice, attrib, size, attribList, returnAttribList, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for glXQueryHyperpipeConfigSGIX function.
		/// </summary>
		/// <param name="dpy">
		/// A <see cref="T:System.IntPtr*"/>.
		/// </param>
		/// <param name="hpId">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="npipes">
		/// A <see cref="T:System.Int32*"/>.
		/// </param>
		public static IntPtr QueryHyperpipeConfigSGIX(ref IntPtr[] dpy, int hpId, ref int[] npipes) {
			IntPtr retvalue;
			unsafe {
				fixed (IntPtr* fp_dpy = dpy)
				fixed (int* fp_npipes = npipes)
				{
					if      (Delegates.pglXQueryHyperpipeConfigSGIX != null)
						retvalue = (Delegates.pglXQueryHyperpipeConfigSGIX(fp_dpy, hpId, fp_npipes));
					else
						throw new InvalidOperationException("binding point QueryHyperpipeConfigSGIX cannot be found");
				}
			}
			LogProc("glXQueryHyperpipeConfigSGIX({0}, {1}, {2}) = {3}", dpy, hpId, npipes, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for glXQueryHyperpipeNetworkSGIX function.
		/// </summary>
		/// <param name="dpy">
		/// A <see cref="T:System.IntPtr*"/>.
		/// </param>
		/// <param name="npipes">
		/// A <see cref="T:System.Int32*"/>.
		/// </param>
		public static IntPtr QueryHyperpipeNetworkSGIX(ref IntPtr[] dpy, ref int[] npipes) {
			IntPtr retvalue;
			unsafe {
				fixed (IntPtr* fp_dpy = dpy)
				fixed (int* fp_npipes = npipes)
				{
					if      (Delegates.pglXQueryHyperpipeNetworkSGIX != null)
						retvalue = (Delegates.pglXQueryHyperpipeNetworkSGIX(fp_dpy, fp_npipes));
					else
						throw new InvalidOperationException("binding point QueryHyperpipeNetworkSGIX cannot be found");
				}
			}
			LogProc("glXQueryHyperpipeNetworkSGIX({0}, {1}) = {2}", dpy, npipes, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for glXQueryMaxSwapBarriersSGIX function.
		/// </summary>
		public static void QueryMaxSwapBarriersSGIX() {
			if      (Delegates.pglXQueryMaxSwapBarriersSGIX != null)
				Delegates.pglXQueryMaxSwapBarriersSGIX();
			else
				throw new InvalidOperationException("binding point QueryMaxSwapBarriersSGIX cannot be found");
			LogProc("glXQueryMaxSwapBarriersSGIX()");
		}

		/// <summary>
		/// Binding for glXReleaseBuffersMESA function.
		/// </summary>
		/// <param name="dpy">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="drawable">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		public static bool ReleaseBuffersMESA(IntPtr dpy, IntPtr drawable) {
			bool retvalue;
			if      (Delegates.pglXReleaseBuffersMESA != null)
				retvalue = (Delegates.pglXReleaseBuffersMESA(dpy, drawable));
			else
				throw new InvalidOperationException("binding point ReleaseBuffersMESA cannot be found");
			LogProc("glXReleaseBuffersMESA({0}, {1}) = {2}", dpy, drawable, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for glXSelectEventSGIX function.
		/// </summary>
		/// <param name="dpy">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="drawable">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="mask">
		/// A <see cref="T:System.UInt32"/>.
		/// </param>
		public static void SelectEventSGIX(IntPtr dpy, IntPtr drawable, UInt32 mask) {
			if      (Delegates.pglXSelectEventSGIX != null)
				Delegates.pglXSelectEventSGIX(dpy, drawable, mask);
			else
				throw new InvalidOperationException("binding point SelectEventSGIX cannot be found");
			LogProc("glXSelectEventSGIX({0}, {1}, {2})", dpy, drawable, mask);
		}

		/// <summary>
		/// Binding for glXSet3DfxModeMESA function.
		/// </summary>
		/// <param name="mode">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		public static bool Set3DfxModeMESA(int mode) {
			bool retvalue;
			if      (Delegates.pglXSet3DfxModeMESA != null)
				retvalue = (Delegates.pglXSet3DfxModeMESA(mode));
			else
				throw new InvalidOperationException("binding point Set3DfxModeMESA cannot be found");
			LogProc("glXSet3DfxModeMESA({0}) = {1}", mode, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for glXSwapBuffersMscOML function.
		/// </summary>
		/// <param name="dpy">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="drawable">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="target_msc">
		/// A <see cref="T:System.Int64"/>.
		/// </param>
		/// <param name="divisor">
		/// A <see cref="T:System.Int64"/>.
		/// </param>
		/// <param name="remainder">
		/// A <see cref="T:System.Int64"/>.
		/// </param>
		public static Int64 SwapBuffersMscOML(IntPtr dpy, IntPtr drawable, Int64 target_msc, Int64 divisor, Int64 remainder) {
			Int64 retvalue;
			if      (Delegates.pglXSwapBuffersMscOML != null)
				retvalue = (Delegates.pglXSwapBuffersMscOML(dpy, drawable, target_msc, divisor, remainder));
			else
				throw new InvalidOperationException("binding point SwapBuffersMscOML cannot be found");
			LogProc("glXSwapBuffersMscOML({0}, {1}, {2}, {3}, {4}) = {5}", dpy, drawable, target_msc, divisor, remainder, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for glXSwapIntervalSGI function.
		/// </summary>
		public static void SwapIntervalSGI() {
			if      (Delegates.pglXSwapIntervalSGI != null)
				Delegates.pglXSwapIntervalSGI();
			else
				throw new InvalidOperationException("binding point SwapIntervalSGI cannot be found");
			LogProc("glXSwapIntervalSGI()");
		}

		/// <summary>
		/// Binding for glXWaitForMscOML function.
		/// </summary>
		/// <param name="dpy">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="drawable">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="target_msc">
		/// A <see cref="T:System.Int64"/>.
		/// </param>
		/// <param name="divisor">
		/// A <see cref="T:System.Int64"/>.
		/// </param>
		/// <param name="remainder">
		/// A <see cref="T:System.Int64"/>.
		/// </param>
		/// <param name="ust">
		/// A <see cref="T:System.Int64*"/>.
		/// </param>
		/// <param name="msc">
		/// A <see cref="T:System.Int64*"/>.
		/// </param>
		/// <param name="sbc">
		/// A <see cref="T:System.Int64*"/>.
		/// </param>
		public static bool WaitForMscOML(IntPtr dpy, IntPtr drawable, Int64 target_msc, Int64 divisor, Int64 remainder, ref Int64[] ust, ref Int64[] msc, ref Int64[] sbc) {
			bool retvalue;
			unsafe {
				fixed (Int64* fp_ust = ust)
				fixed (Int64* fp_msc = msc)
				fixed (Int64* fp_sbc = sbc)
				{
					if      (Delegates.pglXWaitForMscOML != null)
						retvalue = (Delegates.pglXWaitForMscOML(dpy, drawable, target_msc, divisor, remainder, fp_ust, fp_msc, fp_sbc));
					else
						throw new InvalidOperationException("binding point WaitForMscOML cannot be found");
				}
			}
			LogProc("glXWaitForMscOML({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}) = {8}", dpy, drawable, target_msc, divisor, remainder, ust, msc, sbc, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for glXWaitForSbcOML function.
		/// </summary>
		/// <param name="dpy">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="drawable">
		/// A <see cref="T:System.IntPtr"/>.
		/// </param>
		/// <param name="target_sbc">
		/// A <see cref="T:System.Int64"/>.
		/// </param>
		/// <param name="ust">
		/// A <see cref="T:System.Int64*"/>.
		/// </param>
		/// <param name="msc">
		/// A <see cref="T:System.Int64*"/>.
		/// </param>
		/// <param name="sbc">
		/// A <see cref="T:System.Int64*"/>.
		/// </param>
		public static bool WaitForSbcOML(IntPtr dpy, IntPtr drawable, Int64 target_sbc, ref Int64[] ust, ref Int64[] msc, ref Int64[] sbc) {
			bool retvalue;
			unsafe {
				fixed (Int64* fp_ust = ust)
				fixed (Int64* fp_msc = msc)
				fixed (Int64* fp_sbc = sbc)
				{
					if      (Delegates.pglXWaitForSbcOML != null)
						retvalue = (Delegates.pglXWaitForSbcOML(dpy, drawable, target_sbc, fp_ust, fp_msc, fp_sbc));
					else
						throw new InvalidOperationException("binding point WaitForSbcOML cannot be found");
				}
			}
			LogProc("glXWaitForSbcOML({0}, {1}, {2}, {3}, {4}, {5}) = {6}", dpy, drawable, target_sbc, ust, msc, sbc, retvalue);
			return (retvalue);
		}

		/// <summary>
		/// Binding for glXWaitVideoSyncSGI function.
		/// </summary>
		/// <param name="divisor">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="remainder">
		/// A <see cref="T:System.Int32"/>.
		/// </param>
		/// <param name="count">
		/// A <see cref="T:System.UInt32*"/>.
		/// </param>
		public static int WaitVideoSyncSGI(int divisor, int remainder, ref UInt32[] count) {
			int retvalue;
			unsafe {
				fixed (UInt32* fp_count = count)
				{
					if      (Delegates.pglXWaitVideoSyncSGI != null)
						retvalue = (Delegates.pglXWaitVideoSyncSGI(divisor, remainder, fp_count));
					else
						throw new InvalidOperationException("binding point WaitVideoSyncSGI cannot be found");
				}
			}
			LogProc("glXWaitVideoSyncSGI({0}, {1}, {2}) = {3}", divisor, remainder, count, retvalue);
			return (retvalue);
		}

		internal static partial class Delegates
		{
			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate bool glXAssociateDMPbufferSGIX(IntPtr dpy, IntPtr pbuffer, IntPtr* @params, IntPtr dmbuffer);
			internal static glXAssociateDMPbufferSGIX pglXAssociateDMPbufferSGIX = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate int glXBindChannelToWindowSGIX(IntPtr* display, int screen, int channel, IntPtr window);
			internal static glXBindChannelToWindowSGIX pglXBindChannelToWindowSGIX = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate int glXBindHyperpipeSGIX(IntPtr* dpy, int hpId);
			internal static glXBindHyperpipeSGIX pglXBindHyperpipeSGIX = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate void glXBindSwapBarrierSGIX(Int32 window, Int32 barrier);
			internal static glXBindSwapBarrierSGIX pglXBindSwapBarrierSGIX = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate void glXChangeDrawableAttributesSGIX(Int32 drawable);
			internal static glXChangeDrawableAttributesSGIX pglXChangeDrawableAttributesSGIX = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate int glXChannelRectSGIX(IntPtr* display, int screen, int channel, int x, int y, int w, int h);
			internal static glXChannelRectSGIX pglXChannelRectSGIX = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate int glXChannelRectSyncSGIX(IntPtr* display, int screen, int channel, int synctype);
			internal static glXChannelRectSyncSGIX pglXChannelRectSyncSGIX = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate void glXCopySubBufferMESA(IntPtr dpy, IntPtr drawable, int x, int y, int width, int height);
			internal static glXCopySubBufferMESA pglXCopySubBufferMESA = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate void glXCreateContextWithConfigSGIX(Int32 gc_id, Int32 screen, Int32 config, Int32 share_list);
			internal static glXCreateContextWithConfigSGIX pglXCreateContextWithConfigSGIX = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate void glXCreateGLXPbufferSGIX(Int32 config, Int32 pbuffer);
			internal static glXCreateGLXPbufferSGIX pglXCreateGLXPbufferSGIX = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate IntPtr glXCreateGLXPixmapMESA(IntPtr dpy, Glx.XVisualInfo visual, IntPtr pixmap, IntPtr cmap);
			internal static glXCreateGLXPixmapMESA pglXCreateGLXPixmapMESA = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate void glXCreateGLXPixmapWithConfigSGIX(Int32 config, Int32 pixmap, Int32 glxpixmap);
			internal static glXCreateGLXPixmapWithConfigSGIX pglXCreateGLXPixmapWithConfigSGIX = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate void glXCreateGLXVideoSourceSGIX(Int32 dpy, Int32 screen, Int32 server, Int32 path, Int32 @class, Int32 node);
			internal static glXCreateGLXVideoSourceSGIX pglXCreateGLXVideoSourceSGIX = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate void glXCushionSGI(IntPtr dpy, IntPtr window, float cushion);
			internal static glXCushionSGI pglXCushionSGI = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate void glXDestroyGLXPbufferSGIX(Int32 pbuffer);
			internal static glXDestroyGLXPbufferSGIX pglXDestroyGLXPbufferSGIX = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate void glXDestroyGLXVideoSourceSGIX(Int32 dpy, Int32 glxvideosource);
			internal static glXDestroyGLXVideoSourceSGIX pglXDestroyGLXVideoSourceSGIX = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate int glXDestroyHyperpipeConfigSGIX(IntPtr* dpy, int hpId);
			internal static glXDestroyHyperpipeConfigSGIX pglXDestroyHyperpipeConfigSGIX = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate IntPtr glXGetCurrentReadDrawableSGI();
			internal static glXGetCurrentReadDrawableSGI pglXGetCurrentReadDrawableSGI = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate void glXGetDrawableAttributesSGIX(Int32 drawable);
			internal static glXGetDrawableAttributesSGIX pglXGetDrawableAttributesSGIX = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate void glXGetFBConfigsSGIX();
			internal static glXGetFBConfigsSGIX pglXGetFBConfigsSGIX = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate bool glXGetMscRateOML(IntPtr dpy, IntPtr drawable, Int32* numerator, Int32* denominator);
			internal static glXGetMscRateOML pglXGetMscRateOML = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate void glXGetSelectedEventSGIX(IntPtr dpy, IntPtr drawable, UInt32* mask);
			internal static glXGetSelectedEventSGIX pglXGetSelectedEventSGIX = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate bool glXGetSyncValuesOML(IntPtr dpy, IntPtr drawable, Int64* ust, Int64* msc, Int64* sbc);
			internal static glXGetSyncValuesOML pglXGetSyncValuesOML = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate Int32 glXGetTransparentIndexSUN(IntPtr dpy, IntPtr overlay, IntPtr underlay, IntPtr* pTransparentIndex);
			internal static glXGetTransparentIndexSUN pglXGetTransparentIndexSUN = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate int glXGetVideoSyncSGI(UInt32* count);
			internal static glXGetVideoSyncSGI pglXGetVideoSyncSGI = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate int glXHyperpipeAttribSGIX(IntPtr* dpy, int timeSlice, int attrib, int size, IntPtr attribList);
			internal static glXHyperpipeAttribSGIX pglXHyperpipeAttribSGIX = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate int glXHyperpipeConfigSGIX(IntPtr* dpy, int networkId, int npipes, IntPtr* cfg, int* hpId);
			internal static glXHyperpipeConfigSGIX pglXHyperpipeConfigSGIX = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate void glXJoinSwapGroupSGIX(Int32 window, Int32 group);
			internal static glXJoinSwapGroupSGIX pglXJoinSwapGroupSGIX = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate void glXMakeCurrentReadSGI(Int32 drawable, Int32 readdrawable, Int32 context);
			internal static glXMakeCurrentReadSGI pglXMakeCurrentReadSGI = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate int glXQueryChannelDeltasSGIX(IntPtr* display, int screen, int channel, int* x, int* y, int* w, int* h);
			internal static glXQueryChannelDeltasSGIX pglXQueryChannelDeltasSGIX = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate int glXQueryChannelRectSGIX(IntPtr* display, int screen, int channel, int* dx, int* dy, int* dw, int* dh);
			internal static glXQueryChannelRectSGIX pglXQueryChannelRectSGIX = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate int glXQueryGLXPbufferSGIX(IntPtr dpy, IntPtr pbuf, int attribute, UInt32* value);
			internal static glXQueryGLXPbufferSGIX pglXQueryGLXPbufferSGIX = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate int glXQueryHyperpipeAttribSGIX(IntPtr* dpy, int timeSlice, int attrib, int size, IntPtr returnAttribList);
			internal static glXQueryHyperpipeAttribSGIX pglXQueryHyperpipeAttribSGIX = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate int glXQueryHyperpipeBestAttribSGIX(IntPtr* dpy, int timeSlice, int attrib, int size, Int32* attribList, [Out] Int32* returnAttribList);
			internal static glXQueryHyperpipeBestAttribSGIX pglXQueryHyperpipeBestAttribSGIX = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate IntPtr glXQueryHyperpipeConfigSGIX(IntPtr* dpy, int hpId, int* npipes);
			internal static glXQueryHyperpipeConfigSGIX pglXQueryHyperpipeConfigSGIX = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate IntPtr glXQueryHyperpipeNetworkSGIX(IntPtr* dpy, int* npipes);
			internal static glXQueryHyperpipeNetworkSGIX pglXQueryHyperpipeNetworkSGIX = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate void glXQueryMaxSwapBarriersSGIX();
			internal static glXQueryMaxSwapBarriersSGIX pglXQueryMaxSwapBarriersSGIX = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate bool glXReleaseBuffersMESA(IntPtr dpy, IntPtr drawable);
			internal static glXReleaseBuffersMESA pglXReleaseBuffersMESA = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate void glXSelectEventSGIX(IntPtr dpy, IntPtr drawable, UInt32 mask);
			internal static glXSelectEventSGIX pglXSelectEventSGIX = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate bool glXSet3DfxModeMESA(int mode);
			internal static glXSet3DfxModeMESA pglXSet3DfxModeMESA = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate Int64 glXSwapBuffersMscOML(IntPtr dpy, IntPtr drawable, Int64 target_msc, Int64 divisor, Int64 remainder);
			internal static glXSwapBuffersMscOML pglXSwapBuffersMscOML = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal delegate void glXSwapIntervalSGI();
			internal static glXSwapIntervalSGI pglXSwapIntervalSGI = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate bool glXWaitForMscOML(IntPtr dpy, IntPtr drawable, Int64 target_msc, Int64 divisor, Int64 remainder, Int64* ust, Int64* msc, Int64* sbc);
			internal static glXWaitForMscOML pglXWaitForMscOML = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate bool glXWaitForSbcOML(IntPtr dpy, IntPtr drawable, Int64 target_sbc, Int64* ust, Int64* msc, Int64* sbc);
			internal static glXWaitForSbcOML pglXWaitForSbcOML = null;

			[System.Security.SuppressUnmanagedCodeSecurity()]
			internal unsafe delegate int glXWaitVideoSyncSGI(int divisor, int remainder, UInt32* count);
			internal static glXWaitVideoSyncSGI pglXWaitVideoSyncSGI = null;

		}

		internal static partial class Imports
		{
			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXAssociateDMPbufferSGIX", ExactSpelling = true)]
			internal extern static unsafe bool glXAssociateDMPbufferSGIX(IntPtr dpy, IntPtr pbuffer, IntPtr* @params, IntPtr dmbuffer);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXBindChannelToWindowSGIX", ExactSpelling = true)]
			internal extern static unsafe int glXBindChannelToWindowSGIX(IntPtr* display, int screen, int channel, IntPtr window);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXBindHyperpipeSGIX", ExactSpelling = true)]
			internal extern static unsafe int glXBindHyperpipeSGIX(IntPtr* dpy, int hpId);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXBindSwapBarrierSGIX", ExactSpelling = true)]
			internal extern static void glXBindSwapBarrierSGIX(Int32 window, Int32 barrier);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXChangeDrawableAttributesSGIX", ExactSpelling = true)]
			internal extern static void glXChangeDrawableAttributesSGIX(Int32 drawable);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXChannelRectSGIX", ExactSpelling = true)]
			internal extern static unsafe int glXChannelRectSGIX(IntPtr* display, int screen, int channel, int x, int y, int w, int h);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXChannelRectSyncSGIX", ExactSpelling = true)]
			internal extern static unsafe int glXChannelRectSyncSGIX(IntPtr* display, int screen, int channel, int synctype);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXCopySubBufferMESA", ExactSpelling = true)]
			internal extern static void glXCopySubBufferMESA(IntPtr dpy, IntPtr drawable, int x, int y, int width, int height);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXCreateContextWithConfigSGIX", ExactSpelling = true)]
			internal extern static void glXCreateContextWithConfigSGIX(Int32 gc_id, Int32 screen, Int32 config, Int32 share_list);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXCreateGLXPbufferSGIX", ExactSpelling = true)]
			internal extern static void glXCreateGLXPbufferSGIX(Int32 config, Int32 pbuffer);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXCreateGLXPixmapMESA", ExactSpelling = true)]
			internal extern static IntPtr glXCreateGLXPixmapMESA(IntPtr dpy, Glx.XVisualInfo visual, IntPtr pixmap, IntPtr cmap);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXCreateGLXPixmapWithConfigSGIX", ExactSpelling = true)]
			internal extern static void glXCreateGLXPixmapWithConfigSGIX(Int32 config, Int32 pixmap, Int32 glxpixmap);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXCreateGLXVideoSourceSGIX", ExactSpelling = true)]
			internal extern static void glXCreateGLXVideoSourceSGIX(Int32 dpy, Int32 screen, Int32 server, Int32 path, Int32 @class, Int32 node);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXCushionSGI", ExactSpelling = true)]
			internal extern static void glXCushionSGI(IntPtr dpy, IntPtr window, float cushion);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXDestroyGLXPbufferSGIX", ExactSpelling = true)]
			internal extern static void glXDestroyGLXPbufferSGIX(Int32 pbuffer);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXDestroyGLXVideoSourceSGIX", ExactSpelling = true)]
			internal extern static void glXDestroyGLXVideoSourceSGIX(Int32 dpy, Int32 glxvideosource);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXDestroyHyperpipeConfigSGIX", ExactSpelling = true)]
			internal extern static unsafe int glXDestroyHyperpipeConfigSGIX(IntPtr* dpy, int hpId);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXGetCurrentReadDrawableSGI", ExactSpelling = true)]
			internal extern static IntPtr glXGetCurrentReadDrawableSGI();

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXGetDrawableAttributesSGIX", ExactSpelling = true)]
			internal extern static void glXGetDrawableAttributesSGIX(Int32 drawable);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXGetFBConfigsSGIX", ExactSpelling = true)]
			internal extern static void glXGetFBConfigsSGIX();

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXGetMscRateOML", ExactSpelling = true)]
			internal extern static unsafe bool glXGetMscRateOML(IntPtr dpy, IntPtr drawable, Int32* numerator, Int32* denominator);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXGetSelectedEventSGIX", ExactSpelling = true)]
			internal extern static unsafe void glXGetSelectedEventSGIX(IntPtr dpy, IntPtr drawable, UInt32* mask);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXGetSyncValuesOML", ExactSpelling = true)]
			internal extern static unsafe bool glXGetSyncValuesOML(IntPtr dpy, IntPtr drawable, Int64* ust, Int64* msc, Int64* sbc);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXGetTransparentIndexSUN", ExactSpelling = true)]
			internal extern static unsafe Int32 glXGetTransparentIndexSUN(IntPtr dpy, IntPtr overlay, IntPtr underlay, IntPtr* pTransparentIndex);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXGetVideoSyncSGI", ExactSpelling = true)]
			internal extern static unsafe int glXGetVideoSyncSGI(UInt32* count);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXHyperpipeAttribSGIX", ExactSpelling = true)]
			internal extern static unsafe int glXHyperpipeAttribSGIX(IntPtr* dpy, int timeSlice, int attrib, int size, IntPtr attribList);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXHyperpipeConfigSGIX", ExactSpelling = true)]
			internal extern static unsafe int glXHyperpipeConfigSGIX(IntPtr* dpy, int networkId, int npipes, IntPtr* cfg, int* hpId);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXJoinSwapGroupSGIX", ExactSpelling = true)]
			internal extern static void glXJoinSwapGroupSGIX(Int32 window, Int32 group);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXMakeCurrentReadSGI", ExactSpelling = true)]
			internal extern static void glXMakeCurrentReadSGI(Int32 drawable, Int32 readdrawable, Int32 context);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXQueryChannelDeltasSGIX", ExactSpelling = true)]
			internal extern static unsafe int glXQueryChannelDeltasSGIX(IntPtr* display, int screen, int channel, int* x, int* y, int* w, int* h);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXQueryChannelRectSGIX", ExactSpelling = true)]
			internal extern static unsafe int glXQueryChannelRectSGIX(IntPtr* display, int screen, int channel, int* dx, int* dy, int* dw, int* dh);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXQueryGLXPbufferSGIX", ExactSpelling = true)]
			internal extern static unsafe int glXQueryGLXPbufferSGIX(IntPtr dpy, IntPtr pbuf, int attribute, UInt32* value);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXQueryHyperpipeAttribSGIX", ExactSpelling = true)]
			internal extern static unsafe int glXQueryHyperpipeAttribSGIX(IntPtr* dpy, int timeSlice, int attrib, int size, IntPtr returnAttribList);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXQueryHyperpipeBestAttribSGIX", ExactSpelling = true)]
			internal extern static unsafe int glXQueryHyperpipeBestAttribSGIX(IntPtr* dpy, int timeSlice, int attrib, int size, Int32* attribList, [Out]Int32* returnAttribList);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXQueryHyperpipeConfigSGIX", ExactSpelling = true)]
			internal extern static unsafe IntPtr glXQueryHyperpipeConfigSGIX(IntPtr* dpy, int hpId, int* npipes);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXQueryHyperpipeNetworkSGIX", ExactSpelling = true)]
			internal extern static unsafe IntPtr glXQueryHyperpipeNetworkSGIX(IntPtr* dpy, int* npipes);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXQueryMaxSwapBarriersSGIX", ExactSpelling = true)]
			internal extern static void glXQueryMaxSwapBarriersSGIX();

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXReleaseBuffersMESA", ExactSpelling = true)]
			internal extern static bool glXReleaseBuffersMESA(IntPtr dpy, IntPtr drawable);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXSelectEventSGIX", ExactSpelling = true)]
			internal extern static void glXSelectEventSGIX(IntPtr dpy, IntPtr drawable, UInt32 mask);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXSet3DfxModeMESA", ExactSpelling = true)]
			internal extern static bool glXSet3DfxModeMESA(int mode);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXSwapBuffersMscOML", ExactSpelling = true)]
			internal extern static Int64 glXSwapBuffersMscOML(IntPtr dpy, IntPtr drawable, Int64 target_msc, Int64 divisor, Int64 remainder);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXSwapIntervalSGI", ExactSpelling = true)]
			internal extern static void glXSwapIntervalSGI();

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXWaitForMscOML", ExactSpelling = true)]
			internal extern static unsafe bool glXWaitForMscOML(IntPtr dpy, IntPtr drawable, Int64 target_msc, Int64 divisor, Int64 remainder, Int64* ust, Int64* msc, Int64* sbc);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXWaitForSbcOML", ExactSpelling = true)]
			internal extern static unsafe bool glXWaitForSbcOML(IntPtr dpy, IntPtr drawable, Int64 target_sbc, Int64* ust, Int64* msc, Int64* sbc);

			[System.Security.SuppressUnmanagedCodeSecurity()]
			[System.Runtime.InteropServices.DllImport(Library, EntryPoint = "glXWaitVideoSyncSGI", ExactSpelling = true)]
			internal extern static unsafe int glXWaitVideoSyncSGI(int divisor, int remainder, UInt32* count);

		}

	}
}
